import {observable,action} from 'mobx';
import ajx from '../../utils/ajx';
class Model {
    @observable userInfo = '';
    @action setUserInfo = () => {
        

        
    }

    @action setCookie = async () => {
        ajx.post({
            url:'/test/setCookieTest',
            data:{
                name:'hsk',
                age:18
            }
        }).then(async (res)=>{
            this.userInfo = res;
            console.log(res);
        } ).catch((err)=>{
            console.log(err);
        })
    }

    @action getCookie = async () => {
        ajx.get({
            url:'/test/getCookieTest',
            data:{
                name:'hsk',
                age:18
            }
        }).then(async (res)=>{
            this.userInfo = res;
            console.log(res);
        } ).catch((err)=>{
            console.log(err);
        })
    }
}

export default new Model();